
import axios from 'axios';

/**
 * 模型项
 */
export class ModelItemService {
    // 分页查询列表
    static findModelItems (queryParams) {
        return axios({
            url: '/lims/gen/ModelItem/findModelItems',
            method: 'POST',
            data: queryParams
        });
    }

    //根据ID查询指定的模型项
    static findModelItem (modelItemId) {
        const query = {
            modelItemId
        }
        return axios({
            url: '/lims/gen/ModelItem/findModelItem',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的模型项(包含外键名称)
    static findModelItemForView (modelItemId) {
        const query = {
            modelItemId
        }
        return axios({
            url: '/lims/gen/ModelItem/findModelItemForView',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的模型项(包含外键名称)
    static findModelItemForEdit (modelItemId) {
        const query = {
            modelItemId
        }
        return axios({
            url: '/lims/gen/ModelItem/findModelItemForEdit',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的模型项(只提取ID 和 Name)
    static findModelItemsWithIdNameById (modelItemId) {
        const query = {
            modelItemId
        }
        return axios({
            url: '/lims/gen/ModelItem/findModelItemsWithIdNameById',
            method: 'POST',
            params: query,
        });
    }

    //根据名称查询模型项集合(只提取ID 和 Name)
    static findModelItemsWithIdNameByName (modelItemName) {
        const query = {
            modelItemName
        }
        return axios({
            url: '/lims/gen/ModelItem/findModelItemsWithIdNameByName',
            method: 'POST',
            params: query,
        });
    }

    //新增保存模型项
    static saveModelItem (modelItem) {
        const query = {}
        return axios({
            url: '/lims/gen/ModelItem/saveModelItem',
            method: 'POST',
            params: query,
            data: modelItem
        });
    }

    //修改保存模型项
    static updateModelItem (modelItem) {
        const query = {}
        return axios({
            url: '/lims/gen/ModelItem/updateModelItem',
            method: 'POST',
            params: query,
            data: modelItem
        });
    }

    //根据ID查询指定的模型项(只提取ID 和 Name)
    static deleteModelItem (modelItemId) {
        const query = {
            modelItemId
        }
        return axios({
            url: '/lims/gen/ModelItem/deleteModelItem',
            method: 'POST',
            params: query,
        });
    }
}
